package com.xyazm.order.enums;

import lombok.Getter;

/**
 * 售后状态机状态变化枚举
 * @author xuyou
 * 2023-02-02 22:09
*/
@Getter
public enum AfterSaleStateChangeEnum {

    /**
     * 发起售后 0 未创建 -> 10 提交申请
     */
    INITIATE_AFTER_SALE(AfterSaleStatusEnum.UN_CREATED, AfterSaleStatusEnum.COMMITTED, "initiate_after_sale"),
    /**
     * 取消订单 0 未创建 -> 20 审核通过
    */
    CANCEL_ORDER(AfterSaleStatusEnum.UN_CREATED, AfterSaleStatusEnum.REVIEW_PASS,"cancel_order"),
    /**
     * 退款中 20 审核通过 -> 40 退款中
    */
    REFUNDING(AfterSaleStatusEnum.REVIEW_PASS, AfterSaleStatusEnum.REFUNDING,AfterSaleOperateTypeEnum.AFTER_SALE_REFUNDING, "refunding"),
    /**
     * 退款成功 40 退款中 -> 50 退款成功
    */
    REFUND_SUCCESS(AfterSaleStatusEnum.REFUNDING, AfterSaleStatusEnum.REFUNDED, "refund_success"),

    ;


    AfterSaleStateChangeEnum(AfterSaleStatusEnum fromStatus, AfterSaleStatusEnum toStatus, String tags) {
        this.fromStatus = fromStatus;
        this.toStatus = toStatus;
        this.tags = tags;
    }

    AfterSaleStateChangeEnum(AfterSaleStatusEnum fromStatus, AfterSaleStatusEnum toStatus, AfterSaleOperateTypeEnum operateType,String tags) {
        this.fromStatus = fromStatus;
        this.toStatus = toStatus;
        this.operateType = operateType;
        this.tags = tags;
    }


    private AfterSaleStatusEnum fromStatus;
    private AfterSaleStatusEnum toStatus;
    private AfterSaleOperateTypeEnum operateType;
    private String tags;

}
